package 
{
	import com.adobe.serialization.json.JSON;
	import controller.GameController;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	import view.GameView;
	
	import model.*;
	import model.Shapes.*;
	import model.keyboard.*;
	
	import test.TestGeneral;
	
	import view.BoardView;
	import view.ShapeView;
	import view.Square;

	/**
	 * ...
	 * @author Yang Wang
	 */
	[Frame(factoryClass="Preloader")]
	public class Main extends Sprite 
	{

		public function Main():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}

		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			var game:TetrisGame = new TetrisGame();			
			this.addChild(new GameView(game));
			
			var obj:Object = new Object();
			trace(obj.test);
			var controllBinder:ControllBinder = new ControllBinder(new GameController(game), this.stage);
			controllBinder.bind();
			
			
		}

	}
}